home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-24 | 1.7 KB | 69 lines | [TEXT/PJMM] |
- { This file has been processed by The THINK Pascal Source Converter, v1.1.2. }
-
- {------------------------------------------------------------------------------}
-
-
- {$I-}
- program Sample;
-
-
- uses
- Traps, PrintTraps;
-
- procedure Initialize;
-
- var
- ignoreError: OSErr;
- ignoreResult: BOOLEAN;
- ourPrintRecord: THPrint;
- ourReply: StandardFileReply;
- ourOSErr: OSErr;
- ourResRefNum: integer;
-
-
- begin
- InitGraf(@thePort);
- InitFonts;
- InitWindows;
- InitMenus;
- TEInit;
- InitDialogs(nil);
- InitCursor;
-
- PrOpen;
- ourPrintRecord := THPrint(NewHandle(SIZEOF(TPrint)));
- PrintDefault(ourPrintRecord);
- ignoreResult := PrStlDialog(ourPrintRecord);
- ignoreResult := PrJobDialog(ourPrintRecord);
-
- StandardPutFile('Save print record file as', 'My Print Record', ourReply);
- ourOSErr := noErr;
- if ourReply.sfGood then {Did the user accept a file to save as?}
- begin
- if ourReply.sfReplacing then
- ourOSErr := FSpDelete(ourReply.sfFile); { make sure this is gone before we start! }
- if ourOSErr = noErr then
- begin
- FSpCreateResFile(ourReply.sfFile, 'RSED', 'RSRC', ourReply.sfScript);
- ourResRefNum := FSpOpenResFile(ourReply.sfFile, fsWrPerm);
- AddResource(Handle(ourPrintRecord), 'YO!!', 128, 'Saved print record');
- CloseResFile(ourResRefNum);
- end
- else
- SysBeep(10);
- end;
- end;
-
-
- begin
-
- {1.01 - call to ForceEnvirons removed}
- {If you have stack requirements that differ from the default,}
- { then you could use SetApplLimit to increase StackSpace at }
- { this point, before calling MaxApplZone.}
-
- MaxApplZone; {expand the heap so code segments load at the top}
-
- Initialize; {initialize the program}
- ExitToShell;
- end.